package com.yzy.fly.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.mapping.StatementType;


@Mapper
public interface LogCollectorDetailMapper{
//        extends BaseMapper<LogCollectorDetail> {
//
////    @Select("select 1 from dual where 1=1 and 1 = #{tempId} and 1 = #{tempId}")
////    String selectAllByTempId(@Param("tempId") int tempId);
//
//    @Select("select * from log_collector_detail a where 1=1")
//    List<LogCustomSourceDetail> selectAll();
//    @Select("select * from log_collector_detail a where 1=1 and a.parentId = #{parentId}")
//    List<LogCustomSourceDetail> selectAllByParentId(@Param("parentId") int parentId);
//
//    @Select("select * from log_collector_detail a where 1=1 and a.parentId = (select id from log_custom_source b where b.batchNo = #{batchNo})")
//    List<LogCustomSourceDetail> selectAllByBatchNo(@Param("batchNo") String batchNo);
//
//    @Select("select count(${key}) as count from (select JSON_EXTRACT(a.info,'$.${absoluteKey}') as #{key} from log_collector_detail a where a.parentId = (select id from log_custom_source b where b.batchNo = #{batchNo})) as temp")
//    Integer count1KeyByKeyAndBatchNo_object(@Param("batchNo") String batchNo, @Param("key") String key, @Param("absoluteKey") String absoluteKey);
//
//    @Select(" call splitJSONArray_count(#{batchNo},#{key},#{absoluteKey})")
//    @Options(statementType = StatementType.CALLABLE)
//    Integer count1KeyByKeyAndBatchNo_Array(@Param("batchNo") String batchNo, @Param("key") String key, @Param("absoluteKey") String absoluteKey);
//
//    @Select("select count(${key}) as count,${key} from (select JSON_EXTRACT(a.info,'$.${absoluteKey}') as #{key} from log_collector_detail a where a.parentId = (select id from log_custom_source b where b.batchNo = #{batchNo})) as temp GROUP BY ${key} ")
//    List<Map<String,String>> countKeyGourpByKeyByBatchNo_object(@Param("batchNo") String batchNo, @Param("key") String key, @Param("absoluteKey") String absoluteKey);
//
//    @Select(" call splitJSONArray_groupby_count(#{batchNo},#{key},#{absoluteKey})")
//    @Options(statementType = StatementType.CALLABLE)
//    List<Map<String,String>> countKeyGourpByKeyByBatchNo_Array(@Param("batchNo") String batchNo, @Param("key") String key, @Param("absoluteKey") String absoluteKey);


//    @Select({"select count(${key}) as count,${key} from ",
//            " (select JSON_EXTRACT(a.info,'$.${absoluteKey}') as #{key} ",
//            " from log_collector_detail a",
//            " where a.parentId = (select id from log_custom_source b where b.batchNo = #{batchNo})) as temp ",
//            " GROUP BY ${key}"})
//    List<Map<String,String>> countKeyGourpByKeyByBatchNo(@Param("batchNo") String batchNo, @Param("key") String key, @Param("absoluteKey") String absoluteKey);
}